package com.aloda.orangebank.controller;

import com.aloda.orangebank.pojo.Carousel;
import com.aloda.orangebank.pojo.Result;
import com.aloda.orangebank.service.HomepageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/homepage")
public class HomepageController {

    @Autowired
    private HomepageService homepageService;

    @GetMapping("/carousel")
    public Result getCarousel(){
        List<Carousel> carousels = homepageService.getCarousel();
        return Result.success(carousels);
    }
}
